package com.lx.design.demo.ddd3.oop.monster;

import com.lx.design.demo.ddd3.oop.player.Player;
import com.lx.design.demo.ddd3.oop.weapon.Weapon;

/**
 * @author lx
 * @date 2021/4/21 16:17
 */
public class Dragon extends Monster {
    public Dragon(String name,long hp) {
        super.setName(name);
        super.setHealth(hp);
    }

    @Override
    public void receiveDamageBy(Weapon weapon, Player player) {
        if (player instanceof com.lx.design.demo.ddd3.oop.player.Dragoon) {
            //龙骑伤害规则
            this.setHealth(this.getHealth() - weapon.getDamage() * 2);
        }
        //else no damage ,龙免疫力规则
    }
}
